package com.sky.demo.activities;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;

import com.sky.demo.R;
import com.sky.demo.global.BaseActivity;
import com.sky.demo.utils.GuideContoler;
import com.sky.demo.utils.SPUtils;

/** 
* @ClassName: IntroductoryActivity 
* @Description: TODO 首次引导页面
* @author LiBin
* @date 2015年3月26日 下午4:01:00 
*/
public class IntroductoryActivity extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_introductory);
		initViewPager();

	}

	/** 使用写好的库初始化引导页面 **/
	private void initViewPager() {

		GuideContoler contoler = new GuideContoler(this);
//		contoler.setmShapeType(ShapeType.RECT);// 设置指示器的形状为矩形，默认是圆形
		int[] imgIds = { R.mipmap.introductory_01, R.mipmap.introductory_02, R.mipmap.introductory_03};
		LayoutInflater inflater = LayoutInflater.from(this);
		View view = inflater.inflate(R.layout.pager_four, null);
		contoler.init(imgIds, view);
		view.findViewById(R.id.bt_login).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View arg0) {
						SPUtils.put(IntroductoryActivity.this, "isfirst", false);
						startActivity(new Intent(IntroductoryActivity.this,
								MainActivity.class));
						overridePendingTransition(R.anim.in_from_right,
								R.anim.out_to_left);
						finish();
					}
				});

	}
}
